@rem ===== This test is executed from test.bat ======
@echo on

if not exist test1.bat goto nocd
cd bin\win32
"%1" = "EXTEND"
:nocd


@echo ########### 2 palette image #############
@rem Direct support: BMP, DIB, GIF, PCX, PNG, RAS(SUN), TGA, TIF, XPM

gconvert ..\..\images\PEPPER3.bmp test_A.bmp /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\PEPPER3.bmp test_A.bmp /s
@if errorlevel 1 goto error

gconvert ..\..\images\PEPPER3.bmp test_A.dib /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\PEPPER3.bmp test_A.dib /s
@if errorlevel 1 goto error

gconvert test_A.bmp test_A.ftg /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\PEPPER3.bmp test_A.ftg /s
@if errorlevel 1 goto error

gconvert test_A.bmp test_A.gif /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\PEPPER3.bmp test_A.gif /s
@if errorlevel 1 goto error

gconvert test_A.bmp test_A.pcx /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\PEPPER3.bmp test_A.pcx /s
@if errorlevel 1 goto error

gconvert test_A.bmp test_A.png /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\PEPPER3.bmp test_A.png /s
@if errorlevel 1 goto error

gconvert test_A.bmp test_A.ras /Format ras#SUN /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\PEPPER3.bmp test_A.ras /s
@if errorlevel 1 goto error

gconvert test_A.bmp test_A.tga /s
@if errorlevel 1 goto errorc
gcomp test_A.gif test_A.tga /IDX /s
@if errorlevel 1 goto error

gconvert test_A.bmp test_A.tif /s
@if errorlevel 1 goto errorc
gcomp test_A.tga test_A.tif /IDX /s
@if errorlevel 1 goto error

gconvert test_A.bmp test_A.xpm /s
@if errorlevel 1 goto errorc
gcomp test_A.gif test_A.xpm /s
@if errorlevel 1 goto error


@rem ----- limited size <256*256 -----
gconvert test_A.bmp test_A1.bmp -s -Resize 28%
@if errorlevel 1 goto errorc
gconvert test_A1.bmp test_A1.ico -s
@if errorlevel 1 goto errorc
gcomp test_A1.bmp test_A1.ico /s
@if errorlevel 1 goto error


@rem #indirect

gconvert test_A.bmp test_A.txt /s
@if errorlevel 1 goto errorc
gcomp test_A.gif test_A.txt /s
@if errorlevel 1 goto error



@echo ########### 4 palette image #############
@rem Direct support: BMP, GIF, PNG, XPM, TIF

gconvert ..\..\images\HEX_Cnt.gif test_B.bmp /PeelFrame 1 /s

gconvert ..\..\images\HEX_Cnt.gif test_B.gif /PeelFrame 1 /s
@if errorlevel 1 goto errorc
gcomp test_B.bmp test_B.gif /s
@if errorlevel 1 goto error

gconvert ..\..\images\HEX_Cnt.gif test_B.ftg /PeelFrame 1 /s
@if errorlevel 1 goto errorc
gcomp test_B.bmp test_B.ftg /s
@if errorlevel 1 goto error

gconvert ..\..\images\HEX_Cnt.gif test_B.png /PeelFrame 1 /s
@if errorlevel 1 goto errorc
gcomp test_B.bmp test_B.png /s
@if errorlevel 1 goto error

gconvert ..\..\images\HEX_Cnt.gif test_B.tif /PeelFrame 1 /s
@if errorlevel 1 goto errorc
gcomp test_B.bmp test_B.tif /s
@if errorlevel 1 goto error

gconvert ..\..\images\HEX_Cnt.gif test_B.xpm /PeelFrame 1 /s
@if errorlevel 1 goto errorc
gcomp test_B.bmp test_B.xpm /s
@if errorlevel 1 goto error

@rem #indirect

gconvert ..\..\images\HEX_Cnt.gif test_B.txt /PeelFrame 1 /s
@if errorlevel 1 goto errorc
gcomp test_B.bmp test_B.txt /s
@if errorlevel 1 goto error


@echo ########### 16 palette image #############
@rem Direct support: BMP, DIB, GIF, PCX, PNG, RAS#SUN, TIF, WPG, XPM
@rem Indirect support: TXT

gconvert ..\..\images\VGALOGO.rle test_C.bmp /s

@if errorlevel 1 goto errorc
gcomp ..\..\images\VGALOGO.rle test_C.bmp /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.ico /s
@if errorlevel 1 goto error
gcomp test_C.bmp test_C.ico /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.dib /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.dib /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.ftg /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.ftg /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.gif /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.gif /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.pcx /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.pcx /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.png /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.png /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.ps /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.ps /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.ras /Format ras#SUN /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.ras /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.tif /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.tif /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.xpm /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.xpm /s
@if errorlevel 1 goto error

gconvert ..\..\images\VGALOGO.rle test_C.wpg /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.wpg /s
@if errorlevel 1 goto error

@rem #indirect

gconvert ..\..\images\VGALOGO.rle test_C.txt /s
@if errorlevel 1 goto errorc
gcomp test_C.bmp test_C.txt /s
@if errorlevel 1 goto error


@echo ########### 256 palette image #############
@rem Direct support: BMP, DIB, EPS(ps), GIF, PCX, PNG, TGA, TIF, WPG, XPM

gconvert ..\..\images\assist.gif test_D.bmp /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.bmp /s
@if errorlevel 1 goto error

gconvert ..\..\images\assist.gif test_D.dib /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.dib /s
@if errorlevel 1 goto error

gconvert test_D.bmp test_D.ftg /s   
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.ftg /s 
@if errorlevel 1 goto error

@rem @if "%1" == "EXTEND" goto SKIPFAILURE6
rem @if errorlevel 1 goto error
:SKIPFAILURE6

gconvert ..\..\images\assist.gif test_D.gif /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.gif /s
@if errorlevel 1 goto error

gconvert test_D.bmp test_D.pcx /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.pcx /s
@if errorlevel 1 goto error

gconvert test_D.bmp test_D.png /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.png /s
@if errorlevel 1 goto error

gconvert ..\..\images\assist.gif test_D.ps /s
@if errorlevel 1 goto errorc
gcomp test_D.bmp test_D.ps /s
@if errorlevel 1 goto error

gconvert ..\..\images\assist.gif test_D.ras /Format ras#SUN /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.ras /s
@if errorlevel 1 goto error

gconvert ..\..\images\assist.gif test_D.tga /s
@if errorlevel 1 goto errorc
gcomp test_D.bmp test_D.tga /s
@if errorlevel 1 goto error

@rem ===C++ only===
@rem @if not "%1" == "EXTEND" goto SKIPEX2

gconvert ..\..\images\assist.gif test_D.tif /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.tif /s
@if errorlevel 1 goto error

gconvert /Format txt#gm ..\..\images\assist.gif test_D.txt /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.txt /s
@if errorlevel 1 goto error

gconvert ..\..\images\assist.gif test_D.wpg /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.wpg /s
@if errorlevel 1 goto error

gconvert ..\..\images\assist.gif test_D.xpm /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\assist.gif test_D.xpm /s
@if errorlevel 1 goto error


:SKIPEX2


@echo ########### 2 levels monochrome image #############

gconvert ..\..\images\lynne.pcx test_E.art /PeelPlane 7 /s
@if errorlevel 1 goto errorc

gconvert ..\..\images\lynne.pcx test_E.bmp /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.art /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.ftg /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.ftg /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.gif /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.gif /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.oko /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.oko /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.pcx /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.pcx /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.pbm /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.pbm /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.png /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.png /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.ps /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.ps /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.ras /Format ras#topoL /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.ras /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E2.ras /Format ras#SUN /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E2.ras /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.tga /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.tga /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.wbmp /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.wbmp test_E.tga /s
@if errorlevel 1 goto error


@rem ===C++ only===
@rem @if not "%1" == "EXTEND" goto SKIPEX_2MONO

gconvert ..\..\images\lynne.pcx test_E.tif /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.tif /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.wpg /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.wpg /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_E.xpm /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.xpm /s
@if errorlevel 1 goto error

:SKIPEX_2MONO


@rem #indirect


@rem ===C++ only===
@rem @if not "%1" == "EXTEND" goto SKIPEX6

gconvert ..\..\images\lynne.pcx test_E.csv /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E.csv /s
@if errorlevel 1 goto error

gconvert /Format txt#gm ..\..\images\lynne.pcx test_E1.txt /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E1.txt /s
@if errorlevel 1 goto error

:SKIPEX6

gconvert /Format txt#plain ..\..\images\lynne.pcx test_E2.txt /PeelPlane 7 /s
@if errorlevel 1 goto errorc
gcomp test_E.bmp test_E2.txt /s
@if errorlevel 1 goto error



@echo ########### 16 levels gray image #############
@rem Direct support: OKO, TIF, PNG
@rem Indirect support (gray palette): BMP, GIF

gconvert /SeparateIDX ..\..\images\VGALOGO.rle test_F.oko /s
@if errorlevel 1 goto errorc

gconvert /SeparateIDX ..\..\images\VGALOGO.rle test_F.ftg /s
@if errorlevel 1 goto errorc
gcomp test_F.oko test_F.ftg /s
@if errorlevel 1 goto error

gconvert /SeparateIDX ..\..\images\VGALOGO.rle test_F.pgm /s
@if errorlevel 1 goto errorc
gcomp test_F.oko test_F.pgm /s
@if errorlevel 1 goto error

gconvert test_F.pgm test_F.png /s
@if errorlevel 1 goto errorc
gcomp test_F.oko test_F.png /s
@if errorlevel 1 goto error

gconvert /SeparateIDX ..\..\images\VGALOGO.rle test_F.ras /Format ras#SUN /s
@if errorlevel 1 goto errorc
gcomp test_F.oko test_F.ras /s
@if errorlevel 1 goto error

gconvert /SeparateIDX ..\..\images\VGALOGO.rle test_F.tif /s
@if errorlevel 1 goto errorc
gcomp test_F.oko test_F.tif /s
@if errorlevel 1 goto error

@rem Indirect

gconvert test_F.oko test_F.bmp /s
@if errorlevel 1 goto errorc
gcomp test_F.tif test_F.bmp /s
@if errorlevel 1 goto error

gconvert test_F.oko test_F.gif /s
@if errorlevel 1 goto errorc
gcomp test_F.tif test_F.gif /s
@if errorlevel 1 goto error


@echo ########### 256 levels gray image #############

gconvert ..\..\images\lynne.pcx test_G.bmp /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.bmp /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.ftg /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.ftg /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.gif /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.gif /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.ico /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.ico /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.mat /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.mat /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.oko /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.oko /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.pcx /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.pcx /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.png /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.png test_G.pcx /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.ps /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.ps /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.ras /Format ras#topoL /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.ras /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G2.ras /Format ras#SUN /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G2.ras /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.sgi /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.sgi /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.tga /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.tga /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.tif /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.tif /s
@if errorlevel 1 goto error

gconvert /Format txt#plain ..\..\images\lynne.pcx test_G.txt /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.txt /s
@if errorlevel 1 goto error

@rem ===C++ only===
@rem @if not "%1" == "EXTEND" goto SKIPEX1

gconvert ..\..\images\lynne.pcx test_G.csv /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.csv /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.fts /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.fts /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.pgm /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.pgm /s
@if errorlevel 1 goto error

gconvert /Format txt#gm ..\..\images\lynne.pcx test_G.txt /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.txt /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.xpm /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.xpm /s
@if errorlevel 1 goto error

gconvert ..\..\images\lynne.pcx test_G.wpg /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lynne.pcx test_G.wpg /s
@if errorlevel 1 goto error


:SKIPEX1



@echo ########### 65536 levels gray image #############
@rem Direct support: BMP, FITS(fts), MAT, OKO, PNG, XPM

gconvert ..\..\images\lenaI16.mat test_H.ftg /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lenaI16.mat test_H.ftg /s
@if errorlevel 1 goto error

gconvert ..\..\images\lenaI16.mat test_H.bmp /s
@if errorlevel 1 goto errorc
gcomp test_H.ftg test_H.bmp /s
@if errorlevel 1 goto error

gconvert ..\..\images\lenaI16.mat test_H.csv /s
@if errorlevel 1 goto errorc
gcomp test_H.ftg test_H.csv /s
@if errorlevel 1 goto error

gconvert ..\..\images\lenaI16.mat test_H.mat /s
@if errorlevel 1 goto errorc
gcomp test_H.ftg test_H.mat /s
@if errorlevel 1 goto error

gconvert ..\..\images\lenaI16.mat test_H.oko /s
@if errorlevel 1 goto errorc
gcomp test_H.ftg test_H.oko /s
@if errorlevel 1 goto error

gconvert /Format txt#plain ..\..\images\lenaI16.mat test_H.txt /s
@if errorlevel 1 goto errorc
gcomp test_H.mat test_H.txt /s
@if errorlevel 1 goto error

@rem ===C++ only===
@rem @if not "%1" == "EXTEND" goto SKIPEX3

gconvert ..\..\images\lenaI16.mat test_H.fts /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lenaI16.mat test_H.fts /s
@if errorlevel 1 goto error

gconvert ..\..\images\lenaI16.mat test_H.pgm /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lenaI16.mat test_H.pgm /s
@if errorlevel 1 goto error

gconvert ..\..\images\lenaI16.mat test_H.png /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\lenaI16.mat test_H.png /s
@if errorlevel 1 goto error

gconvert /Format txt#gm ..\..\images\lenaI16.mat test_H.txt /s
@if errorlevel 1 goto errorc
gcomp test_H.mat test_H.txt /s
@if errorlevel 1 goto error

@rem gconvert ..\..\images\lenaI16.mat test_H.sgi /s
@rem @if errorlevel 1 goto errorc
@rem gcomp test_H.mat test_H.tif /s
@rem @if errorlevel 1 goto error

gconvert ..\..\images\lenaI16.mat test_H.tif /s
@if errorlevel 1 goto errorc
gcomp test_H.mat test_H.tif /s
@if errorlevel 1 goto error

gconvert ..\..\images\lenaI16.mat test_H.xpm /s
@if errorlevel 1 goto errorc
gcomp test_H.mat test_H.xpm /s
@if errorlevel 1 goto error


@echo ########### RGB 16 bit color image #############

gconvert ..\..\images\input_16.tga test_8.bmp /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\input_16.tga test_8.bmp /s
@if errorlevel 1 goto error

gconvert ..\..\images\input_16.tga test_8.tga /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\input_16.tga test_8.tga /s
@if errorlevel 1 goto error

gconvert ..\..\images\input_16.tga test_8.tif /s
@if errorlevel 1 goto errorc
gcomp test_8.tga test_8.tif /s
@if errorlevel 1 goto error




:SKIPEX3
@echo ########### RGB 24 bit color image #############
@rem Indirect support: AAI, AVS


gconvert ..\..\images\i24.bmp test_4.ftg /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\i24.bmp test_4.ftg /s
@if errorlevel 1 goto errorc

gconvert test_4.ftg test_4.bmp /s
@if errorlevel 1 goto errorc
gcomp test_4.ftg test_4.bmp /s
@if errorlevel 1 goto errorc

gconvert ..\..\images\i24.bmp test_4.bmp /s
@if errorlevel 1 goto errorc

gconvert ..\..\images\i24.bmp test_4.ico /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.ico /s
@if errorlevel 1 goto error

gconvert ..\..\images\i24.bmp test_4.mat /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.mat /s
@if errorlevel 1 goto error

gconvert test_4.bmp test_4.pcx /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.pcx /s
@if errorlevel 1 goto error

gconvert test_4.bmp test_4.eps /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.eps /s
@if errorlevel 1 goto error

gconvert test_4.bmp test_4a.ras /Format ras#topoL /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4a.ras /s
@if errorlevel 1 goto error

gconvert test_4.bmp test_4b.ras /Format ras#SUN /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4b.ras /s
@if errorlevel 1 goto error

gconvert test_4.bmp test_4.sgi /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.sgi /s
@if errorlevel 1 goto error

gconvert test_4.bmp test_4.tga /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.tga /s
@if errorlevel 1 goto error


@rem ===C++ only===
@rem @if not "%1" == "EXTEND" goto SKIPEX4

gconvert /Format txt#gm test_4.bmp test_4.txt /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.txt /s
@if errorlevel 1 goto error


gconvert test_4.bmp test_4.fts /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.fts /s
@if errorlevel 1 goto error


gconvert test_4.bmp test_4.png /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.png /s
@if errorlevel 1 goto error

gconvert test_4.bmp test_4.ppm /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.ppm /s
@if errorlevel 1 goto error

gconvert test_4.bmp test_4.tif /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.tif /s
@if errorlevel 1 goto error


@rem -------------- indirect ----------------

gconvert test_4.bmp test_4.aai /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.aai /s
@if errorlevel 1 goto error

gconvert test_4.bmp test_4.avs /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.avs /s
@if errorlevel 1 goto error


:SKIPEX4


@rem -------------- Fuzzy ----------------

gconvert ..\..\images\i24.bmp test_4.jpg /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.jpg /s /Fuzzy
@if errorlevel 1 goto error

gconvert ..\..\images\i24.bmp test_4.webp /s
@if errorlevel 1 goto errorc
gcomp test_4.bmp test_4.webp /s /Fuzzy
@if errorlevel 1 goto error



@echo ########### ARGB 32 bit color image #############
@rem Direct support: AAI, AVS, BMP, PCX, PNG, TIFF

gconvert ..\..\images\gracehop.bmp test_Y.aai /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\gracehop.bmp test_Y.aai /s
@if errorlevel 1 goto error

gconvert ..\..\images\gracehop.bmp test_Y.avs /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\gracehop.bmp test_Y.avs /s
@if errorlevel 1 goto error

gconvert ..\..\images\gracehop.bmp test_Y.pcx /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\gracehop.bmp test_Y.pcx /s
@if errorlevel 1 goto error

gconvert ..\..\images\gracehop.bmp test_Y.png /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\gracehop.bmp test_Y.png /s
@if errorlevel 1 goto error

gconvert ..\..\images\gracehop.bmp test_Y.sgi /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\gracehop.bmp test_Y.sgi /s
@if errorlevel 1 goto error

gconvert ..\..\images\gracehop.bmp test_Y.tif /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\gracehop.bmp test_Y.tif /s
@if errorlevel 1 goto error

gconvert /Format txt#gm ..\..\images\gracehop.bmp test_Y.txt /s
@if errorlevel 1 goto errorc
gcomp test_Y.pcx test_Y.txt /s
@if errorlevel 1 goto error




@echo ############# Floats ###################

gconvert ..\..\images\floatmsb.fts test_Z.csv /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\floatmsb.fts test_Z.csv /s
@if errorlevel 1 goto error

gconvert ..\..\images\floatmsb.fts test_Z.fts /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\floatmsb.fts test_Z.fts /s
@if errorlevel 1 goto error

gconvert test_Z.fts test_Z.mat /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\floatmsb.fts test_Z.fts /s
@if errorlevel 1 goto error

gconvert /Format txt#plain ..\..\images\floatmsb.fts test_Z.txt /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\floatmsb.fts test_Z.txt /s
@if errorlevel 1 goto error



@echo ############# Doubles ###################

@rem ===C++ only===
@rem @if not "%1" == "EXTEND" goto SKIPEX5

gconvert ..\..\images\double.mat test_5.csv /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\double.mat test_5.csv /s
@if errorlevel 1 goto error

gconvert ..\..\images\double.mat test_5.fts /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\double.mat test_5.fts /s
@if errorlevel 1 goto error

gconvert test_5.fts test_5.mat /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\double.mat test_5.fts /s
@if errorlevel 1 goto error

gconvert /Format txt#plain ..\..\images\double.mat test_5.txt /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\double.mat test_5.txt /s
@if errorlevel 1 goto error

:SKIPEX5


@echo ############# Multiple frames ###################


gconvert ..\..\images\HEX_Cnt.gif test_9.bmp /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\HEX_Cnt.gif test_9.bmp /s
@if errorlevel 1 goto error

gconvert ..\..\images\HEX_Cnt.gif test_9.ftg /s
@if errorlevel 1 goto errorc
gcomp test_9.bmp test_9.ftg /s
@if errorlevel 1 goto error

gconvert ..\..\images\HEX_Cnt.gif test_9.gif /s
@if errorlevel 1 goto errorc
gcomp test_9.bmp test_9.gif /s
@if errorlevel 1 goto error

@rem Gray only
@rem gconvert ..\..\images\HEX_Cnt.gif test_9.mat /s
@rem @if errorlevel 1 goto errorc
@rem gcomp test_9.bmp test_9.mat /s
@rem @if errorlevel 1 goto error

gconvert ..\..\images\HEX_Cnt.gif test_9.tga /s
@if errorlevel 1 goto errorc
gcomp test_9.gif test_9.tga /s
@if errorlevel 1 goto error

gconvert ..\..\images\HEX_Cnt.gif test_9.tif /s
@if errorlevel 1 goto errorc
gcomp test_9.gif test_9.tif /s
@if errorlevel 1 goto error

gconvert ..\..\images\HEX_Cnt.gif test_9.txt /s
@if errorlevel 1 goto errorc
gcomp test_9.gif test_9.txt /s
@if errorlevel 1 goto error


@echo ############# Palette quantisation ###################

gconvert ..\..\images\i24.bmp test_Z.gif /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\i24.bmp test_Z.gif /s /fuzzy 250
@if errorlevel 1 goto errorc


gconvert ..\..\images\i24.bmp test_Z.wpg /s
@if errorlevel 1 goto errorc
gcomp ..\..\images\i24.bmp test_Z.wpg /s /fuzzy 250
@if errorlevel 1 goto errorc



@echo ############# END OF TESTS ###################


@echo off
@echo ###############################################

@echo on
@rem del test_?.*

del test_?.*
del test_??.*

@echo off
goto done

:errorc
@echo off
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo convert of image has been failed
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
goto done

:error
@echo off
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo Test procedure has been failed.
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

:done

